package com.feib.soeasy.service;

import java.util.List;
import java.util.Set;

import org.springframework.transaction.annotation.Transactional;

import com.feib.soeasy.model.LabelValue;
import com.feib.soeasy.model.MenuItem;
import com.feib.soeasy.pagination.PaginatedList;

/**
 * @title (#)MenuItemService.java<br>
 * @description <br>
 * @author Anson Tsai<br>
 * @version 1.0.0 2010/11/25
 * @copyright Far Eastern International Bank Copyright (c) 2010<br>
 * @2010/12/4 create by Anson Tsai<br>
 */
@Transactional(readOnly = true)
public interface MenuItemService {

    /**
     * 列出所有的程式清單，照MenuId排序
     * 
     * @return
     */
    public List<MenuItem> getAllMenuItemOrderMenuId();
    
    /**
     * 列出學校的程式清單，照MenuId排序
     * @return
     */
    public List<MenuItem> getSchoolMenuItemOrderMenuId();
    
    /**
     * 列出管委會的程式清單，照MenuId排序
     * 
     * @return
     */
    public List<MenuItem> getCommitteeMenuItemOrderMenuId();
    
    /**
     * 將傳入的MenuItem重新查詢出物件
     * @param menuItems
     * @return
     */
    public Set<MenuItem> findMenuItem(Set<MenuItem> menuItems);
    
    /**
     * 
     * @param menuType
     * @param menuId
     * @param actionName
     * @param paginationConfig
     * @return
     */
    public PaginatedList<MenuItem> queryByConditions(String menuType, String menuId, String actionName, PaginatedList<MenuItem> paginationConfig);
    
    /**
     * 
     * @param menuItemPk
     * @return
     */
    public MenuItem getMenuItemByPk(Long menuItemPk);
    
    /**
     * 取得所有的群組Item
     * @return
     */
    public List<LabelValue> findLabelValueByParentMenuItem();    
    
    /**
     * 儲存功能
     * @param m
     */
    @Transactional(readOnly = false)
    public MenuItem save(MenuItem m);
    
    /**
     * 刪除功能
     * @param m
     */
    @Transactional(readOnly = false)
    public void delete(MenuItem m);

    /**
     * @return
     */
    public List<MenuItem> queryAllLazyRoles();
}
